package com.lanchetech.dao;

import com.lanchetech.bean.request.PageReq;import com.lanchetech.bean.request.TimeTypeReq;import com.lanchetech.bean.vo.CardFlowVO;import com.lanchetech.bean.vo.StatisticsVO;import com.lanchetech.bean.vo.TotalStatisticsVO;import com.lanchetech.entity.CardFlow;
import java.math.BigDecimal;import java.util.Date;import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

@Mapper
public interface CardFlowMapper {
    int deleteByPrimaryKey(Long id);

    int insert(CardFlow record);

    int insertSelective(CardFlow record);

    CardFlow selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(CardFlow record);

    int updateByPrimaryKey(CardFlow record);

    int updateBatch(List<CardFlow> list);

    int updateBatchSelective(List<CardFlow> list);

    int batchInsert(@Param("list") List<CardFlow> list);

    List<CardFlowVO> findAllPage(PageReq req);

    TotalStatisticsVO getTotalCardFlow(TimeTypeReq req);

    List<StatisticsVO> getCardFlowStatistics(TimeTypeReq req);

    List<CardFlow> getCardFlowRecordRank(TimeTypeReq req);

    List<StatisticsVO> getCardFlowCurrentMonth(@Param("userId") Long userId, @Param("type") Byte type, @Param("date") Date date);

    BigDecimal getUsedSumByUserId(@Param("userId") Long id, @Param("type") Byte pay);

    BigDecimal sumByUserIdAndType(@Param("userId")Long userId,@Param("type")Byte type);

    CardFlow findOneByTypeAndRelateId(@Param("type")Byte type,@Param("relateId")Long relateId);



}